import data from './year-24.js'

// 转换为数字
const numbers = data.map((entry) => Number(entry.number))

// 统计每个号码的出现次数
const frequency = numbers.reduce((acc, number) => {
  acc[number] = (acc[number] || 0) + 1
  return acc
}, {})

// 按出现次数排序
const sortedNumbers = Object.entries(frequency).sort((a, b) => b[1] - a[1])

// 取前 25 个热号和后 25 个冷号
const hotNumbers = sortedNumbers.slice(0, 25).map((item) => Number(item[0]))
const coldNumbers = sortedNumbers.slice(-24).map((item) => Number(item[0]))

// 输出结果
console.log('热号:', hotNumbers)
console.log('冷号:', coldNumbers)
